package com.cc.user.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@ApiModel(value = "RegistUserEntity", description = "注册用户对象")
public class RegistUserEntity {

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "电话号码", dataType = "String", required = true)
    private String phone;

    @NotEmpty(message = "密码必须填写")
    @Length(min = 6,max = 18,message = "密码必须是6—18位字符")
    @ApiModelProperty(value = "密码", dataType = "Integer", required = true)
    private String password;

    @NotEmpty(message = "验证码不能为空")
    @ApiModelProperty(value = "验证码", dataType = "String", required = true)
    private String code;

    @NotNull(message = "用户种类不能为空")
    @ApiModelProperty(value = "权限,1:普通员工2:客户", dataType = "Integer", required = true, allowableValues = "1,2")
    private Integer permission;

    @ApiModelProperty(value = "店铺名称", dataType = "String")
    private String shopName;

    @ApiModelProperty(value = "联系人姓名", dataType = "String")
    private String contactName;

    @ApiModelProperty(value = "店铺地址", dataType = "String")
    private String shopAddress;
}
